<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta name="HandheldFriendly" content="True">
    <link rel="shortcut icon" href="<?php echo urldecode(Url::urlFormat("@favicon.ico"));?>"/>
    <link rel="bookmark" href="<?php echo urldecode(Url::urlFormat("@favicon.ico"));?>" />
<link href="<?php echo urldecode(Url::urlFormat("#css/bootstrap.css"));?>" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="<?php echo urldecode(Url::urlFormat("#css/common.css"));?>">
    <link rel="stylesheet" type="text/css" href="<?php echo urldecode(Url::urlFormat("#css/font-awesome.min.css"));?>">
    <link rel="stylesheet" type="text/css" href="<?php echo urldecode(Url::urlFormat("#js/artdialog/tiny-dialog.css"));?>">
 <link rel="stylesheet" type="text/css" href="<?php echo urldecode(Url::urlFormat("@static/css/font_icon.css"));?>" />
<link href="<?php echo urldecode(Url::urlFormat("#css/city-picker.css"));?>" rel="stylesheet">
<link href="<?php echo urldecode(Url::urlFormat("#css/main.css"));?>" rel="stylesheet">
   <style type="text/css">
        .swiper-container {width: 100%;}
        .js-template{display:none !important;}
    </style>
    <script src="<?php echo urldecode(Url::urlFormat("#js/jquery.min.js"));?>"></script>
    <script src="<?php echo urldecode(Url::urlFormat("#js/artdialog/dialog-plus-min.js"));?>"></script>
    <script src="<?php echo urldecode(Url::urlFormat("#js/common.js"));?>"></script>
    <script src="<?php echo urldecode(Url::urlFormat("#js/tinyslider.js"));?>"></script>
    <!-- <script src="<?php echo urldecode(Url::urlFormat("#js/bootstrap.js"));?>"></script> -->
    <script src="<?php echo urldecode(Url::urlFormat("#js/city-picker.data.js"));?>"></script>
    <script src="<?php echo urldecode(Url::urlFormat("#js/city-picker.js"));?>"></script>
    <script src="<?php echo urldecode(Url::urlFormat("#js/main.js"));?>"></script>
    <script type="text/javascript">
        var server_url = '<?php echo urldecode(Url::urlFormat("@"));?>__con__/__act__';
        var Tiny = {user:{name:'<?php echo isset($user['name'])?$user['name']:'';?>',id:'<?php echo isset($user['id'])?$user['id']:0;?>',online:<?php echo isset($user['id']) && $user['id']?'true':'false';?>}};
    </script>
    <title><?php if(isset($seo_title) && isset($site_title) && ($seo_title == $site_title)){?><?php echo isset($seo_title)?$seo_title:"";?><?php }else{?><?php echo isset($seo_title)?$seo_title:"";?>-<?php echo isset($site_title)?$site_title:"";?><?php }?></title>
</head>

<body>
    <!-- S 头部区域 -->
    <div id="header">
        <div class="topbar">
            <div class="layout-2 container">
                <div class="sub-1">
                    <!--
<div class="docs-methods">
    <form class="form-inline">
        <div id="distpicker">
            <div class="form-group">
                <div style="position: relative;">
                    <input id="city-picker3" class="form-control" readonly type="text" value="" data-toggle="city-picker">
                </div>
            </div>
        </div>
    </form>
</div>
                    -->
                </div>
                <div class="sub-2">
                    <ul class="nav-x">
                        <!-- 
                        <li class="item down">
                            <a href="<?php echo urldecode(Url::urlFormat("/ucenter"));?>">会员中心<i class="fa">&#xf107;</i></a>
                            <div class="dropdown user-box">
                                <?php $sidebar_nav = array('我的订单'=>'order', '我的关注'=>'attention', '商品咨询'=>'consult', '商品评价'=>'review', '我的消息'=>'message', '收货地址'=>'address', '我的优惠券'=>'voucher', '账户金额'=>'account');?>
                                <ul class="user-center">
                                    <?php foreach($sidebar_nav as $key => $item){?>
                                    <li class="link"><a href="<?php echo urldecode(Url::urlFormat("/ucenter/$item"));?>"><?php echo isset($key)?$key:"";?></a></li>
                                    <?php }?>
                                </ul>
                            </div>
                        </li>
                        <li class="item split"></li>
                        <li class="item down"><a href="">APP下载</a>
                            <div class="dropdown">
                                <img src="">
                            </div>
                        </li>
                        <li class="item split"></li>
                        <li class="item"><a href="<?php echo urldecode(Url::urlFormat("/ucenter/order"));?>">我的订单</a></li>
                        -->
                        <li class="item split"></li>
                        <?php if($user){?>
                        <li class="item"><?php if(isset($user['name'])){?>你好:<a href="<?php echo urldecode(Url::urlFormat("/ucenter/index"));?>"><?php echo isset($user['name'])?$user['name']:"";?></a>
                        进入 <a href="<?php echo urldecode(Url::urlFormat("/ucenter/index"));?>" style="color:red;">个人中心</a>
                         - <?php }?><a href="<?php echo urldecode(Url::urlFormat("/simple/logout"));?>">安全退出</a></li>
                        <?php }else{?>
                        <li class="item">
                            <a class="normal" href="<?php echo urldecode(Url::urlFormat("/simple/login"));?>">登录</a>
                            <!--/<a class="normal" href="<?php echo urldecode(Url::urlFormat("/simple/reg"));?>">注册</a>-->
                        </li>
                        <?php }?>
                        <li class="item"><a target="_blank" class="normal" href="<?php echo urldecode(Url::urlFormat("/simple/cart"));?>">购物车</a></li>
                    </ul>
                </div>
                
            </div>
        </div>
        <div class="container head-main">
            <!-- <div class="sub-1 logo"></div> -->
            <div class="sub-1">
            <a href="<?php echo urldecode(Url::urlFormat("/index/index"));?>"><img src="<?php echo urldecode(Url::urlFormat("@$site_logo"));?>" style="margin-top:20px;"></a></div>
            <div class="sub-2">
                <form id="search-form" class="search-form" action="<?php echo urldecode(Url::urlFormat("/"));?>" method="get">
                    <input type="hidden" name="con" value="index">
                    <input type="hidden" name="act" value="search">
                    <input type='hidden' name='tiny_token_' value='<?php echo Tiny::app()->getToken("");?>'/>
                    <input class="search-keyword" id="search-keyword" class="txt-keyword" name="keyword" value="" type="text">
                    <button class="btn-search ">搜索</button>
					<!-- 
                    <p id="tags-list"><?php $item=null; $query = new Query("tags");$query->order = "is_hot desc,sort desc,num desc";$query->limit = "3";$items = $query->find(); foreach($items as $key => $item){?><a href="#"><?php echo isset($item['name'])?$item['name']:"";?></a><?php }?></p>
                    -->
                </form>
            </div>
            <!-- 
            <div class="sub-3">
                <div class="shopping" id="shopping-cart"><i class="icon-cart-32"></i>购物车
                    <div class="dropdown">
                        <ul class="cart-box " id="cart-list">
                            <?php $total=0.00;?><?php if($cart){?><?php foreach($cart as $key => $item){?> <?php $total += $item['amount'];?>
                            <li class="cart-item" id="<?php echo isset($item['id'])?$item['id']:"";?>">
                                <div class="pic">
                                    <a class="card-pic" href="<?php echo urldecode(Url::urlFormat("/index/product/id/$item[goods_id]"));?>" target="_blank" title="<?php echo isset($item['name'])?$item['name']:"";?>"><img src="<?php echo urldecode(Url::urlFormat("@$item[img]"));?>" width="50" height="50"></a>
                                </div>
                                <div class="spec">
                                    <?php foreach($item['spec'] as $key => $spec){?>
                                    <p title="<?php echo isset($spec['name'])?$spec['name']:"";?>:<?php echo isset($spec['value'][2])?$spec['value'][2]:"";?>"><?php echo isset($spec['value'][2])?$spec['value'][2]:"";?></p>
                                    <?php }?>
                                </div>
                                <div class="num"><?php echo isset($item['num'])?$item['num']:"";?></div>
                                <div class="price" title="<?php echo isset($item['amount'])?$item['amount']:"";?>"><?php echo isset($item['amount'])?$item['amount']:"";?></div>
                                <a class="icon-close-16 ie6png" productid="<?php echo isset($item['id'])?$item['id']:"";?>"></a>
                            </li>
                            <?php }?>
                            <?php }else{?>
                            <li><div>购物车中还没有商品，赶紧选购吧！</div></li>
                            <?php }?>

                        </ul>
                        <div class="cart-count">
                            <span>合计：</span><span class="cart-total"><?php echo isset($total)?$total:"";?></span>
                            <a href="<?php echo urldecode(Url::urlFormat("/simple/cart"));?>" class="btn btn-main">去购物车结算</a>
                        </div>
                    </div>
                </div>
            </div>
            -->
        </div>
        <!-- S 导航栏 -->
        <div class="nav">
            <ul class="container">
                <li class="category-box">
                    <div class="link">
                    <a href="javascript:;" style="color: #fff;">全部分类<i class="triangle-b"></i></a>
                    </div>
                    <ul class="category">
                        <?php $current_category_ids='';$parent_category='';?>
                        <?php foreach($category as $key => $categ){?>
                        <li><a href="<?php echo urldecode(Url::urlFormat("/index/category/cid/$categ[id]"));?>">
                            <?php if(isset($categ['id'])){?>
                            <?php $current_category_ids=$categ['id'].',';$parent_category=$categ['id'];?>
                            <?php }?> <?php echo isset($categ['title'])?$categ['title']:"";?><i class="fa">&#xf105;</i></a>
                            <div class="category-sub">
                                <ul class="sub">
                                    <?php foreach($categ['child'] as $key => $child){?>
                                    <li>
                                        <h5><a href="<?php echo urldecode(Url::urlFormat("/index/category/cid/$child[id]"));?>">
                                            <?php if(isset($child['id'])){?>
                                            <?php $current_category_ids.=$child['id'].',';?>
                                            <?php }?>
                                            <?php echo isset($child['title'])?$child['title']:"";?></a></h5>
                                            <p>
                                                <?php if(isset($child['child'])){?>
                                                <?php foreach($child['child'] as $key => $grandson){?>
                                                <a href="<?php echo urldecode(Url::urlFormat("/index/category/cid/$grandson[id]"));?>">
                                                    <?php if(isset($grandson['id'])){?>
                                                    <?php $current_category_ids.=$grandson['id'].',';?><?php }?>
                                                    <?php echo isset($grandson['title'])?$grandson['title']:"";?></a>
                                                    <?php }?>
                                                    <?php }?>
                                                </p>
                                            </li>
                                            <?php }?>
                                        </ul>
                                    </div>
                                </li>
                                <?php }?>
                            </ul>
                        </li>
                        <li class="link"><a href="<?php echo urldecode(Url::urlFormat("/index/index/flag/0"));?>">首页</a></li>

                        <li class="link"><a href="<?php echo urldecode(Url::urlFormat("/index/index/condition_g_s/point/flag/1"));?>">购物积分专区</a></li>
                        <li class="link"><a href="<?php echo urldecode(Url::urlFormat("/index/index/flag/2"));?>">重消积分专区</a></li>

                        <?php $item=null; $query = new Query("nav");$query->where = "type = 'main' and enable = 1";$query->order = "`sort` desc";$items = $query->find(); foreach($items as $key => $item){?>
                        <li class="link"><a href="<?php if(strstr($item['link'],'http://')===false){?><?php echo urldecode(Url::urlFormat("$item[link]"));?><?php }else{?><?php echo isset($item['link'])?$item['link']:"";?><?php }?>" target="<?php if($item['open_type']==1){?>_blank<?php }else{?>_self<?php }?>"><?php echo isset($item['name'])?$item['name']:"";?></a></li>
                        <?php }?>
                    </ul>
                </div>
                <!-- E 导航栏 -->
            </div>
            <!-- E 头部区域 -->
            <!-- S 主控区域 -->
            <div id="main">
               <link type="text/css" rel="stylesheet" href="<?php echo urldecode(Url::urlFormat("#css/ucenter.css"));?>" />
<?php echo JS::import('form');?>
<?php echo JS::import('date');?>
<?php echo JS::import('dialog?skin=tinysimple');?>
<script type="text/javascript" charset="UTF-8" src="<?php echo urldecode(Url::urlFormat("#js/jquery.iframe-post-form.js"));?>"></script>
<script src="<?php echo urldecode(Url::urlFormat("#js/bootstrap.js"));?>"></script>
<div class="container clearfix">
	<div id='widget_sub_navs'><?php $widget = Widget::createWidget('sub_navs');$widget->action = "ucsidebar";$widget->sidebar = $sidebar;$widget->act = $actionId;$widget->cache = "false";$widget->run();?></div>
	<div class="content clearfix uc-content">
		<h1 class="title"><span>注册会员：</span></h1>
		<!-- 
		<span>推广连接：<a target="blank" href="<?php echo urldecode(Url::urlFormat("/simple/reg/num/$user[number]"));?>">
			http://www.ahcysc.com/index.php?con=simple&act=reg&num=<?php echo isset($user[number])?$user[number]:"";?> 
			</a><label style="font-size:12px;">(右键复制链接地址)</label>
			</span>
			<br>
			<span>
				<?php $url=urlencode(Common::get_complete_path("/simple/reg/num/$user[number]"));?>
				<img src="<?php echo urldecode(Url::urlFormat("/simple/get_qrcode_img_by_url/url/$url"));?>"/>
			</span>
		-->	
		
		<?php if(isset($msg)){?>
		<div class="message_<?php echo isset($msg[0])?$msg[0]:"";?> ie6png"><?php echo isset($msg[1])?$msg[1]:"";?></div>
		<?php }elseif(isset($validator)){?>
		<div class="message_warning ie6png"><?php echo isset($validator['msg'])?$validator['msg']:"";?></div>
		<?php }?>
		
		<!--<table border="0">-->
			<!--<tr>-->
				<!--<td>-->
					<!--分享连接：<a target="blank" href="<?php echo urldecode(Url::urlFormat("/simple/reg/num/$user[number]"));?>">-->
			<!--http://www.ahcysc.com/index.php?con=simple&act=reg&num=<?php echo isset($user[number])?$user[number]:"";?> -->
			<!--</a><label style="font-size:12px;">(右键复制链接地址)</label>-->
				<!--</td>-->
			<!--</tr>-->
			<!--<tr>-->
				<!--<td>-->
					<!--<?php $url=urlencode(Common::get_complete_path("/simple/reg/num/$user[number]"));?>-->
					<!--<img src="<?php echo urldecode(Url::urlFormat("/simple/get_qrcode_img_by_url/url/$url"));?>"/>-->
				<!--</td>-->
			<!--</tr>-->
			<!--<tr>-->
				<!--<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>扫一扫 二维码</span></td>-->
			<!--</tr>-->
		<!--</table>		-->
			
		
		<div class="mt10" style="position:relative;margin-left:100px;">

			<!--<form id="info-form" class="simple" action="<?php echo urldecode(Url::urlFormat("/ucenter/reg_act"));?>" method="post">-->
				<table class="form">
					<!-- <tr><td class="label">会员帐号：</td><td><?php if(Validator::match('\d+@no.com',$info['email'])){?><input type="text" pattern="email" name="email" value="<?php echo isset($email)?$email:"";?>" alt="邮箱格式错误"> <label></label><?php }else{?><?php echo isset($email)?$email:"";?><?php }?></td></tr> -->
					<!-- <tr><td class="label">会员级别：</td><td><?php echo isset($gname)?$gname:'默认分组';?></td></tr> -->
					<tr>
						<td class="label">推荐人：</td><td>
						<input type="text" pattern="required" id="tjr_name" name="tjr_name"  value="<?php echo isset($user[name])?$user[name]:"";?>" alt="推荐人不能为空">
						</td>
					</tr>
					<tr>
						<td class="label">用户名：</td><td>
						<input type="text" pattern="required" name="uname" id="uname" value="" alt="用户名不能为空" placeholder='字母数字组合'>
						</td>
					</tr>
					<tr>
						<td class="label">真实姓名：</td><td>
						<input type="text" pattern="required" name="real_name" id="real_name" value="" alt="真实姓名不能为空">
					</td>
					</tr>
					<tr>
						<td class="label">手机号：</td><td>
						<input type="text" pattern="^1[3-9]\d{9}$" name="telphone" id="telphone" value="" alt="手机号填写不正确">
					</td>
					</tr>
					<tr>
						<td class="label">身份证号：</td><td>
						<input type="text" name="identity" id="identity" value="">
					</td>
					</tr>
					<tr>
						<td class="label">登录密码：</td><td><input placeholder='6-20位字母数字组合' type="password" pattern="required" id="password" name="password" minlen="6" maxlen="20" value="" alt="密码长度为6-20位"> <label></label></td>
					</tr>
					<tr>
						<td class="label">确认登录密码：</td><td><input placeholder='6-20位字母数字组合' type="password" pattern="required" id="repassword" name="repassword" minlen="6" maxlen="20" value="" alt="密码长度为6-20位"> <label></label></td>
					</tr>
					<tr>
						<td class="label">交易密码：</td><td><input placeholder='6-20位字母数字组合' type="password" pattern="required" name="passwordtwo" id="passwordtwo" minlen="6" maxlen="20" value="" alt="密码长度为6-20位"> <label></label></td>
					</tr>
					<tr>
						<td class="label">确认交易密码：</td><td><input placeholder='6-20位字母数字组合' type="password" pattern="required" name="repasswordtwo" id="repasswordtwo" minlen="6" maxlen="20" value="" alt="密码长度为6-20位"> <label></label></td>
					</tr>
					<tr>
						<td class="label">投资级别：</td>
						<td>
							<select pattern="required" name="agent" id="agent" alt="请选择类别" style="width:210px;">
								<option value="">请选择投资级别</option>
								<?php $item=null; $query = new Query("grade");$items = $query->find(); foreach($items as $key => $item){?>
								<option value="<?php echo isset($item['id'])?$item['id']:"";?>"><?php echo isset($item['name'])?$item['name']:"";?>(<?php echo isset($item['money'])?$item['money']:"";?>)</option>
								<?php }?>
							</select>
						</td>
					</tr>
					<tr>
						<td class="label"></td>
						<td>
							<select  id="province" name ="province">
								<option value="">==省份/直辖市==</option>
								<?php $item=null; $query = new Query("area");$query->where = "parent_id = 0";$items = $query->find(); foreach($items as $key => $item){?>
								<option value="<?php echo isset($item['id'])?$item['id']:"";?>"><?php echo isset($item['name'])?$item['name']:"";?></option>
								<?php }?>
							</select>
							<select id="city" name="city">
								<option value="">==市==</option>
							</select>
							<select id="county" name="county">
								<option value="">==县/区==</option>
							</select>
						</td>
					</tr>
					<!--<tr>-->
						<!--<td class="label">短信验证码：</td>-->
						<!--<td>-->
							<!--<?php if(Validator::mobi($info['mobile'])){?><?php echo isset($mobile)?$mobile:"";?><?php }else{?>-->
							<!--<input type="text" pattern="\d{6}" name="validate_code" id="validate_code" value="" alt="短信验证码为6为数字"><label></label><?php }?>-->
							<!--<input type="button" value="获取短信验证码" class="btn btn-main" onclick="get_validate_code()"/>-->
						<!--</td>-->
					<!--</tr>-->

					<tr>
						<td class="label">

						</td>
						<td>
							<input type="checkbox" id="chk_read_me" name="chk_read_me" value="1">
							我已阅读并同意 &lt;&lt;<a id="user-license" style="color:red;" href="javascript:;"> <?php echo isset($site_title)?$site_title:"";?>用户注册协议 </a>&gt;&gt;
						</td>
					</tr>
					<tr>
						<td colspan="2" class="tc"><input type="button" id="button_submit" class="btn btn-main" value="提交"></td>
					</tr>
				</table>
				<!--<input type='hidden' name='tiny_token_reg' value='<?php echo Tiny::app()->getToken("reg");?>'/>-->
			<!--</form>-->
		</div>
	</div>
</div>
<div id="head-dialog" style="display: none">
	<div class="box" style="width:400px;">
		<h2>上传头像：</h2>
		<div class="content mt20 p10">
			<form enctype="multipart/form-data" action="<?php echo urldecode(Url::urlFormat("/ucenter/upload_head"));?>" method="post"  id="uploadForm">
				<p><input type="file" name="imgFile" ></p>
				<p class="mt20 tc"><button class="btn" id="upload-btn">上传</button></p>
			</form>
		</div>
	</div>
</div>

<!--注册协议-->
<div class="modal fade" id="myModal_1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
						aria-hidden="true">&times;</span></button>
				<h4 class="modal-title" id="myModalLabel">注册协议：</h4>
			</div>
			<div class="modal-body" id="myModalContent">
				<div class="form-horizontal" data-validate="parsley">
					<?php $item=null; $query = new Query("help");$query->where = "id = 14";$items = $query->find(); foreach($items as $key => $item){?>
					<?php echo isset($item['content'])?$item['content']:"";?>
					<?php }?>
					<!--
                    <section class="panel panel-default">

                        <div class="panel-body">

                        </div>
                    </section>
                    -->
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">
	$(function(){
		$("#button_submit").click(function(){
			var tjr_name = $("#tjr_name").val();
			var uname    = $("#uname").val();
			var real_name = $('#real_name').val();
			var telphone = $('#telphone').val();
			var identity = $('#identity').val();
			var password    = $("#password").val();
			var repassword    = $("#repassword").val();
			var passwordtwo    = $("#passwordtwo").val();
			var repasswordtwo  = $("#repasswordtwo").val();
			var agent = $("#agent").val();
			var province      = $("#province").val();
			var city          = $("#city").val();
			var county    = $("#county").val();

			if(tjr_name == '') {
				alert('推荐人不能为空!');
				return false;
			}
			if(uname == '') {
				alert('用户名不能为空!');
				return false;
			}
			else {
				var pattern_uname = /^[0-9a-zA-Z]*$/;
				if(!pattern_uname.test( uname ))
				{
					alert('用户名请输入数字和字母组合!');
					return false;
				}
			}
			if (real_name == '') {
				alert('真实姓名不能为空!');
				return false;
			}
			if (telphone == '') {
				alert('电话不能为空!');
				return false;
			}
			else {
				var pattern = /^1[3-9]\d{9}$/;
				if(!pattern.test( telphone ))
				{
					alert('请填写正确的电话号码!');
					return false;
				}
			}
			if (identity == '') {
				alert('身份证号不能为空!');
				return false;
			}
			else {
				var pattern_id = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
				if(!pattern_id.test( identity ))
				{
					alert('请填写正确的身份证号!');
					return false;
				}
			}
			if(password == '') {
				alert('登录密码不能为空!');
				return false;
			}
			if(repassword == '') {
				alert('确认登录密码不能为空!');
				return false;
			}
			if(password !== repassword) {
				alert('两次登录密码输入不一致!');
				return false;
			}
			if(passwordtwo == '') {
				alert('交易密码不能为空!');
				return false;
			}
			if(repasswordtwo == '') {
				alert('确认交易密码不能为空!');
				return false;
			}
			if(passwordtwo !== repasswordtwo) {
				alert('两次交易密码输入不一致!');
				return false;
			}
			if(agent == '') {
				alert('投资级别不能为空!');
				return false;
			}
			if(province == '') {
				alert('请选择省份/直辖市!');
				return false;
			}
			if(city == '') {
				alert('请选择市!');
				return false;
			}
			if(county == '') {
				alert('请选择县/区!');
				return false;
			}
			if ($("#chk_read_me").is(':checked') != true) {
				alert('请选择同意用户注册协议!');
				return false;
			}
			//alert(province+" "+city+" "+county);
			$.post("<?php echo urldecode(Url::urlFormat("/ucenter/reg_act"));?>",{tjr_name:tjr_name,uname:uname,real_name:real_name,telphone:telphone,identity:identity,password:password,passwordtwo:passwordtwo,agent:agent,province:province,city:city,county:county},function(data){
//				alert(data['msg']);
				if(data['status'] == 'fail') {
					alert(data['msg']);
				} else{
					window.location.href = "<?php echo urldecode(Url::urlFormat("/ucenter/action_list"));?>";
				}
			},'json');

		});
	});


	$("#upload-link").on("click",function (){
		art.dialog({id:'head-dialog',content:document.getElementById('head-dialog'),lock:true});
	});

	$("#uploadForm").iframePostForm({
		iframeID: 'iframe-post-form',
		json:true,
		post: function(){
			$("#upload-btn").text("上传中...")
		},
		complete: function(data){
			if(data['error']==1){
				alert(data['message']);
			}else{
				var root_url = "<?php echo urldecode(Url::urlFormat("@"));?>"
				$("#head-pic").attr("src",root_url+data['url']+'?i='+Math.random());
				art.dialog({id:'head-dialog'}).close();
			}
			$("#upload-btn").text("上传");
		}

	});

	var form =  new Form('info-form');
	form.setValue('is_default','<?php echo isset($is_default)?$is_default:"";?>');
	$("#areas").Linkage({ url:"<?php echo urldecode(Url::urlFormat("/ajax/area_data"));?>",selected:[<?php echo isset($province)?$province:0;?>,<?php echo isset($city)?$city:0;?>,<?php echo isset($county)?$county:0;?>],callback:function(data){
		var text = new Array();
		var value = new Array();
		for(i in data[0]){
			if(data[0][i]!=0){
				text.push(data[1][i]);
				value.push(data[0][i]);
			}
		}
		$("#test").val(value.join(','));
		FireEvent(document.getElementById("test"),"change");
	}});
	<?php if(isset($invalid)){?>
	autoValidate.showMsg({id:$("input[name='<?php echo isset($invalid['name'])?$invalid['name']:"";?>']").get(0),error:true,msg:'<?php echo isset($invalid['msg'])?$invalid['msg']:"";?>'});
	
	<?php }?>
	
	
		function get_validate_code()
		{
			var mobile = $.trim($("#uname").val());
			if(mobile == '')
			{
				alert('手机号码不能为空');
				return;
			}
			var mobile_pattern = /^((1[3-9]\d{9})|(\d{14}))$/;
			if(!mobile_pattern.test(mobile))
			{
				alert('手机号码不合法');
				return;
			}
			
			$("#btn_get_validate").attr("disabled", true);
			$.post("<?php echo urldecode(Url::urlFormat("/simple/sms_send"));?>",{mobile:mobile},function(result){
			      alert(result);
			      $("#btn_get_validate").attr("disabled", false);
			  });
		}
	
</script>
<script type="text/javascript">
//	$('#agent').change(function(){
//		$("#province").removeAttr('disabled');
//		$("#city").removeAttr('disabled');
//		$("#county").removeAttr('disabled');
//
//		var u_lx = $(this).val();
//		if (u_lx == 1 || u_lx == 2) {
//			$("#province").attr('disabled',true).val(0);
//			$("#city").attr('disabled',true).val(0);
//			$("#county").attr('disabled',true).val(0);
//		} else if (u_lx == 4) {
//			$("#county").attr('disabled',true).val(0);
//		}
//	});


	$(function(){
		$("#province").change(function(){
			var id = $(this).val();

			if(id == '')
			{
				$("#city").html("<option value=''>==市==</option>");
				$("#county").html("<option value=''>==县/区==</option>");
			}
			else
			{
				$.post("<?php echo urldecode(Url::urlFormat("/ucenter/transform"));?>",{id:id},function(data){
//					alert(data);
					$("#city").html("<option value=''>==市==</option>");
					$("#county").html("<option value=''>==县/区==</option>");
					$("#city").append(data);
				},'text');
			}

		});

		$("#city").change(function(){
			var id = $(this).val();
			if(id == '')
			{
				$("#county").html("<option value=''>==县/区==</option>");
			}
			else
			{
				$.post("<?php echo urldecode(Url::urlFormat("/ucenter/transform"));?>",{id:id},function(data){
					$("#county").html("<option value=''>==县/区==</option>");
					$("#county").append(data);
				},'text');

			}

		})

	});
</script>
<!--<script type="text/javascript">-->
	<!--<?php if(!empty($invalid)){?>-->
	<!--$("#div_msg").text("<?php echo isset($invalid[msg])?$invalid[msg]:"";?>")-->
	<!--<?php }?>-->

	<!--function show_msg( msg )-->
	<!--{-->
		<!--$("#div_msg").text(msg);-->
		<!--setTimeout(function(){-->
			<!--$("#div_msg").text('');-->
		<!--},3000);-->
	<!--}-->
<!--</script>-->
<script type="text/javascript">
	$("#user-license").on("click",function(){
		$("#myModal_1").modal();
	});

</script>


           </div>
           <!-- E 主控区域 -->

           <!-- S 底部区域 -->
           
           <div id="footer">
            <div class="promise">
                <div class="clearfix container">
                    <dl>
                        <dt class="icon-1"></dt>
                        <dd>
                            <p class="title">诚信交易</p>
                            <p>所有产品均出正规渠道采购</p>
                        </dd>
                    </dl>
                    <dl>
                        <dt class="icon-2"></dt>
                        <dd>
                            <p class="title">60元包邮</p>
                            <p>全国各地，满60元快递包邮</p>
                        </dd>
                    </dl>
                    <dl>
                        <dt class="icon-3"></dt>
                        <dd>
                            <p class="title">极速更新</p>
                            <p>所有商品信息及时更新</p>
                        </dd>
                    </dl>
                    <dl>
                        <dt class="icon-4"></dt>
                        <dd>
                            <p class="title">7天退换货</p>
                            <p>会员享受7天无理由退换货</p>
                        </dd>
                    </dl>
                    <dl>
                        <dt class="icon-5"></dt>
                        <dd>
                            <p class="title">真实拍摄</p>
                            <p>100%真实拍摄，杜绝虚假</p>
                        </dd>
                    </dl>
                </div>
            </div>
            <div class="helps clearfix container">
                <?php $item=null; $query = new Query("help_category");$query->order = "sort desc";$query->limit = "5";$items = $query->find(); foreach($items as $key => $item){?>
                <dl >
                    <dt class="clearfix"><span class="icon-<?php echo isset($item['alias'])?$item['alias']:"";?> fl"></span><a href="javascript:;"><?php echo isset($item['name'])?$item['name']:"";?></a></dt>
                    <?php $help=null; $query = new Query("help");$query->where = "category_id = $item[id]";$query->item = "$help";$query->cache = "true";$query->cacheTime = "1200";$items = $query->find(); foreach($items as $key => $help){?>
                    <dd><a href="<?php echo urldecode(Url::urlFormat("/index/help/id/$help[id]"));?>"><?php echo isset($help['title'])?$help['title']:"";?></a></dd>
                    <?php }?>
                </dl>
                <?php }?>
                <div class="col-contact">
                    <p class="phone">0371-53625762
                    </p>
                    <p>周一至周日 8:00-18:00
                        <br>（仅收市话费）</p>
                        <a class="btn btn-main">24小时在线客服</a>
                    </div>
                </div>
                <div class="copyright">
                    <div class="container bootom">
                        <div class="sub-1">
                        	<!-- 
                            <div class="logo"></div>
                            -->
                        </div>
                        
                        <div class="sub-2">
                        	<!-- 
                            <div><?php $item=null; $query = new Query("nav");$query->where = "type = 'bottom'";$query->order = "`sort` desc";$items = $query->find(); foreach($items as $key => $item){?>
                                <a href="<?php if(strstr($item['link'],'http://')===false){?><?php echo urldecode(Url::urlFormat("$item[link]"));?><?php }else{?><?php echo isset($item['link'])?$item['link']:"";?><?php }?>" target="<?php if($item['open_type']==1){?>_blank<?php }else{?>_self<?php }?>"><?php echo isset($item['name'])?$item['name']:"";?></a>
                                <?php }?></div>
                                -->
                                <!-- 
                                <span>Powered by <a href="#"><b style="color: #e74503"><?php echo isset($site_title)?$site_title:"";?></b></a> © 201-</span></div>
                                -->
                                <div class="sub-3">
                                    <a target="_blank" href="#"><img src="<?php echo urldecode(Url::urlFormat("#images/v-logo-2.png"));?>" alt="诚信网站"></a>
                                    <a target="_blank" href="#"><img src="<?php echo urldecode(Url::urlFormat("#images/v-logo-1.png"));?>" alt="诚信网站"></a>
                                    <a target="_blank" href="#"><img src="<?php echo urldecode(Url::urlFormat("#images/v-logo-3.png"));?>" alt="网上交易保障中心"></a>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <!-- E 底部区域 -->
                    <script>
                        $(".slider").Slider();
                        $(".category li").mouseenter(function() {
                            $(this).addClass("hover");
                        }).mouseleave(function() {
                            $(this).removeClass("hover");
                        });

                        $("#tags-list a").each(function(){
                            $(this).on("click",function(){
                                $("#search-keyword").val($(this).text());
                                $("#search-form").submit();
                            })
                        });
                        $(".category-box").mouseenter(function(){
                            $(this).addClass("on");
                        }).mouseleave(function(){
                            $(this).removeClass("on");
                        });

                        function updateCart(data){
                            var card_items = '';
                            for(var i in data){
                                var spec = data[i]['spec'];
                                var spec_str = '';
                                for(var k in spec){
                                    spec_str +="<p>"+spec[k]['value'][2]+"</p>";
                                }
                                card_items += '<div class="cart-item" id="'+i+'"><div class="pic"><img src="<?php echo urldecode(Url::urlFormat("@"));?>'+data[i]['img']+'" width="50" height="50"></div><div class="spec">'+spec_str+'</div><div class="num">'+data[i]['num']+'</div><div class="price">'+(data[i]['amount'])+'</div><a class="icon-close-16 ie6png" productid="'+data[i]['id']+'"></a></div>';
                            }
                            $("#cart-list").empty().append(card_items);
                            changeCartInfo();
                            bindDelEvent();
                        }
                        bindDelEvent();
                        function bindDelEvent(){
                            $("#shopping-cart .icon-close-16").on("click",function(){
                                var btn_close = $(this);
                                $.post("<?php echo urldecode(Url::urlFormat("/index/cart_del"));?>",{id:btn_close.attr("productid")},function(){
                                    btn_close.parent().remove();
                                    changeCartInfo();
                                    $("#card-wrap").css({top:1-$("#card-wrap").outerHeight()},"fast");
                                },"json");
                            });
                        }

                        function changeCartInfo(){
                            $(".cart-product-num").text($(".cart-item").size());
                            var total = 0.00;
                            $(".cart-item .price").each(function(){
                                total += parseFloat($(this).text());
                            });
                            $(".cart-total").text(total.toFixed(2));
                            if($(".cart-item").size()==0){
                                $("#cart-list").empty().append('<li><div>购物车中还没有商品，赶紧选购吧！</div></li>');
                            }
                        }
                        $("#tags-list a").each(function(){
                            $(this).on("click",function(){
                                $("#search-keyword").val($(this).text());
                                $("#search-form").submit();
                            })
                        });
                        
                        
                        
                        /**
                        *左侧菜单栏的关闭和打开
                        */
                        $(function(){
                        	/*
                        	$("div[class='box'] h2").toggle(function(){
                        		$(this).next("ul").hide('2000');
                        	},function(){
                        		$(this).next("ul").show('2000');
                        	});
                        	*/
                        	
                        	$("div[class='box'] h2").click(function(){
                        		//$(this).next("ul").hide('2000');
                        		var $ul = $(this).next("ul");
                        		if($ul.is(':visible'))
                        		{
                        			$ul.hide("2000");
                        		}
                        		else
                        		{
                        			$ul.show("2000");	
                        		}
                        		
                        	});
                        	
                        	
                        });
                        
                        
                    </script>
                </body>
                </html>

<!--Powered by TinyRise-->